package top.digger.web.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.digger.web.entity.DataShPoint;
import top.digger.web.entity.common.AjaxResult;
import top.digger.web.mapper.DataShPointMapper;
import top.digger.web.service.DataReportService;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@Service
public class DataReportServiceImpl implements DataReportService {

    @Autowired
    private DataShPointMapper dataShPointMapper;

    public AjaxResult getShPoint(){
        Date now = new Date();
        Date last = new Date(now.getTime() - 1000L * 3600 * 24 * 100);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        List<DataShPoint> dataShPointList = dataShPointMapper.selectDataShPoint(last, now);

        return AjaxResult.success(dataShPointList);
    }
}
